const { pathsToModuleNameMapper } = require("ts-jest");
const { defaults } = require("jest-config");
const { compilerOptions } = require("./tsconfig.json");
let moduleNameMapper = pathsToModuleNameMapper(compilerOptions.paths || {}, { prefix: "<rootDir>/" });
// console.log(moduleNameMapper);
/** @type {import('jest').Config} */
const config = {
  preset: "ts-jest",
  roots: ["<rootDir>"],
  transform: {
    "^.+\\.tsx?$": "ts-jest"
  },
  moduleNameMapper: moduleNameMapper,
  moduleFileExtensions: [...defaults.moduleFileExtensions, "mts"],
  setupFilesAfterEnv: ["<rootDir>/test/setup.ts"]
};
module.exports = config;
